<template>
	<view>
		<!-- 页面内容 -->
		<text>预约日期：{{ appointmentDate }}</text>
		<text>预约时间：{{ appointmentTime }}</text>
		<text>住预约人：{{ appointmentname }}</text>
		<text>证件号码：{{ appointmentidNumber }}</text>
		<text>证件类型：{{ appointmentselectedValue }}</text>
		<text>手机号码：{{ appointmentphone }}</text>

		<text>儿童数量：{{ appointmentselected }}</text>

	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import {
		onMounted
	} from 'vue';
	import {
		onLoad
	} from '@dcloudio/uni-app';

	const appointmentDate = ref('');
	const appointmentTime = ref('');
	const appointmentname = ref('');
	const appointmentidNumber = ref('');
	const appointmentselectedValue = ref('');
	const appointmentphone = ref('');

	const appointmentselected = ref(0);
	// 使用onLoad生命周期钩子来接收参数
	onLoad((options) => {

		appointmentDate.value = options.date;
		appointmentTime.value = options.time;
		appointmentname.value = options.name;
		appointmentidNumber.value = options.idNumber;
		appointmentselectedValue.value = options.selectedValue;
		appointmentphone.value = options.phone;

		if (options.selected) {
			// 将传递的字符串转换为数字
			appointmentselected.value = parseInt(options.selected, 10);
		}

	});
</script>